package com.iplant.mes.service.po.sfc;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;
import com.iplant.mes.service.mesenum.sfc.SFCBoxReportStatus;

import java.util.ArrayList;
import java.util.List;

/**
 * 成品报工（箱码报工）
 *
 * @author YouWang·Peng
 * 2023-9-11 09:18:16
 */
@DBBasePO(TableName = "sfc_box_report", Name = false, Active = false, Schemas = DBSchemas.MES,
        CheckName = {"Code"}, CodeAuto = true, CodePrefix = "SBR-{yyyyMMdd}-", CodeNum = 4)
public class SFCBoxReport extends BasePO {
    /**
     * 订单ID
     */
    @DBCondition
    @DBField
    public int OrderID = 0;
    /**
     * 订单号
     */
    @DBCondition
    @DBField
    public String OrderNo = "";

    @DBCondition
    @DBField
    public int ProductID = 0;

    @DBJoin(name = "Code", tableName = "fpc_product", tableAsName = "fpc_product1", Schemas = DBSchemas.PDM,
            MainTableField = "ProductID")
    public String ProductNo = "";

    @DBJoin(name = "Name", tableName = "fpc_product", tableAsName = "fpc_product1", Schemas = DBSchemas.PDM,
            MainTableField = "ProductID")
    public String ProductName = "";

    /**
     * 箱码ID集合
     */
    @DBField
    public List<Integer> WorkpieceRecordIDList = new ArrayList<>();

    /**
     * 箱码信息列表
     */
    public List<SFCWorkpieceRecord> WorkpieceRecordList = new ArrayList<>();

    /**
     * 状态
     */
    @DBCondition
    @DBField
    public int Status = 0;

    public String StatusText = "";

    @JsonProperty("OrderID")
    public int getOrderID() {
        return OrderID;
    }

    public void setOrderID(int orderID) {
        OrderID = orderID;
    }

    @JsonProperty("OrderNo")
    public String getOrderNo() {
        return OrderNo;
    }

    public void setOrderNo(String orderNo) {
        OrderNo = orderNo;
    }

    @JsonProperty("ProductID")
    public int getProductID() {
        return ProductID;
    }

    public void setProductID(int productID) {
        ProductID = productID;
    }

    @JsonProperty("ProductNo")
    public String getProductNo() {
        return ProductNo;
    }

    public void setProductNo(String productNo) {
        ProductNo = productNo;
    }

    @JsonProperty("ProductName")
    public String getProductName() {
        return ProductName;
    }

    public void setProductName(String productName) {
        ProductName = productName;
    }

    @JsonProperty("WorkpieceRecordIDList")
    public List<Integer> getWorkpieceRecordIDList() {
        return WorkpieceRecordIDList;
    }

    public void setWorkpieceRecordIDList(List<Integer> workpieceRecordIDList) {
        WorkpieceRecordIDList = workpieceRecordIDList;
    }

    @JsonProperty("WorkpieceRecordList")
    public List<SFCWorkpieceRecord> getWorkpieceRecordList() {
        return WorkpieceRecordList;
    }

    public void setWorkpieceRecordList(List<SFCWorkpieceRecord> workpieceRecordList) {
        WorkpieceRecordList = workpieceRecordList;
    }

    @JsonProperty("Status")
    public int getStatus() {
        return Status;
    }

    public void setStatus(int status) {
        Status = status;
    }

    @JsonProperty("StatusText")
    public String getStatusText() {
        StatusText = SFCBoxReportStatus.getEnumType(Status).getLabel();
        return StatusText;
    }

    public void setStatusText(String statusText) {
        StatusText = statusText;
    }
}
